/**
 * 
 */
package com.snapp.util.object.model;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Vector;

import org.jdom.Element;
import org.jdom.JDOMException;

import com.snapp.util.Bean;
import com.snapp.util.templates.Processor;

/**
 * @author Kile
 *
 */
public interface ObjectModel extends Serializable{
	
	String getIdName();
	
	int getResultCode();
	void setResultCode(int resultCode);
	String getResultMessage();
	void setResultMessage(String resultMessage);
	
	void setSNAppGlobalName(String snobGlobalName);
	String getSNAppGlobalName();
	void setBean(Bean bean);
	Bean getBean();
	
	void fromBean(Bean bean);
	
	String getId();
	
	ObjectModel copy();
	
	ObjectModel duplicateInstance();
	
	String getTableName();
	Vector<String> getPropertyNames();
	Vector<String> getPropertyTypes();
	Processor getTemplateProcessor(ObjectModel o) throws IllegalAccessException, InstantiationException;
	
	Vector<ObjectModel> list(HashMap<String, String> filterParams);
	Vector<ObjectModel> list(String filter);
	Vector<ObjectModel> list(String filter, HashMap<String, String> params);

	int count(HashMap<String, String> filterParams);
	int count(String filter);
	int count(String filter, HashMap<String, String> params);
	
	void delete(HashMap<String, String> filterParams);
	void delete(String filter);
	
	void load(HashMap<String, String> filterParams);
	void load(String filter);
	
	void save();
	void save(HashMap<String, Object> saveParams);

	void saveList(HashMap<String, Object> params, String delimiter);
	
	String filterParamsToString(HashMap<String, String>filterParams);
	
	Element toXML() throws JDOMException;
}
